<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>点微博数据</title>
  <script include="jquery" src="./static/libs/include-lib-local.js"></script>
  <script include="proj4,mapv" src="./static/libs/include-leaflet-local.js"></script>
  <style>
    body {
      margin: 0;
      padding: 0;
    }

    #map {
      position: absolute;
      top: 0;
      bottom: 0;
      width: 100%;
    }
  </style>
</head>

<body>
  <div id="map"></div>
  <script>
    var map = L.map('map').setView([29.578285, 106.563777], 5);
    L.tileLayer('https://map.geoq.cn/arcgis/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}', {
        attribution: '<a href="#">MapGIS</a>',
        maxZoom: 18,
        id: 'mapbox.dark'
      }).addTo(map);


    $.get('../../static/data/mapv/weibo.json', function (rs) {
      console.log(rs);
      var data1 = [];
      var data2 = [];
      var data3 = [];
      var data4 = [];
      for (var i = 0; i < rs[0].length; i++) {
        var geoCoord = rs[0][i].geoCoord;
        data1.push({
          geometry: {
            type: 'Point',
            coordinates: geoCoord
          }
        });
      }

      for (var i = 0; i < rs[1].length; i++) {
        var geoCoord = rs[1][i].geoCoord;
        data2.push({
          geometry: {
            type: 'Point',
            coordinates: geoCoord
          },
          time: Math.random() * 10
        });
      }

      for (var i = 0; i < rs[2].length; i++) {
        var geoCoord = rs[2][i].geoCoord;
        data3.push({
          geometry: {
            type: 'Point',
            coordinates: geoCoord
          },
        });
      }

      var dataSet = new mapv.DataSet(data1);
      var options = {
        fillStyle: 'rgba(200, 200, 0, 0.8)',
        bigData: 'Point',
        size: 0.7,
        draw: 'simple',
      }
      var mapvLayer = new L.zondy.MapvLayer(map, dataSet, options).addTo(map);

      var dataSet = new mapv.DataSet(data2);
      var options = {
        fillStyle: 'rgba(255, 250, 0, 0.8)',
        size: 0.7,
        bigData: 'Point',
        draw: 'simple',
      }
      var mapvLayer = new L.zondy.MapvLayer(map, dataSet, options).addTo(map);

      var dataSet = new mapv.DataSet(data3);
      var options = {
        fillStyle: 'rgba(255, 250, 250, 0.6)',
        size: 0.7,
        bigData: 'Point',
        draw: 'simple',
      }
      var mapvLayer = new L.zondy.MapvLayer(map, dataSet, options).addTo(map);

      var dataSet = new mapv.DataSet(data2);
      var options = {
        fillStyle: 'rgba(255, 250, 250, 0.9)',
        size: 1.1,
        draw: 'simple',
        bigData: 'Point',
        animation: {
          stepsRange: {
            start: 0,
            end: 10
          },
          trails: 1,
          duration: 6,
        }
      }
      var mapvLayer = new L.zondy.MapvLayer(map, dataSet, options).addTo(map);
    });
  </script>


</body>

</html>